#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QFileDialog>
#include <QMessageBox>
#include <QSize>
#include <QFile>
#include <QTextStream>
#include <QToolButton>
#include <QToolBar>
#include <QComboBox>
#include <QAction>
#include <QPrintPreviewWidget>
#include <QPrinter>
#include <QPainter>
#include <QPrintPreviewDialog>
#include <QTreeWidget>
#include <QPixmap>
#include "bookview.h"
#include "abstractview.h"
#include "qzip.h"
#include "qtreeitem.h"
#include "qtreemodel.h"
#include "defaultview.h"
#include "singlepageview.h"

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void setTreeViewModel(QTreeModel* model){ view->setModel(model);}
    QDockWidget* getIndexDock(){return dock;}
protected:
    virtual void mouseReleaseEvent(QMouseEvent *);
private:
    Ui::MainWindow *ui;
    QToolBar *fileToolBar;
    QToolBar *editToolBar;
    QAction *newLetterAct;
    QAction *previousPageAct;
    QAction *nextPageAct;
    QTreeView* view ;
    QDockWidget *dock;
    AbstractView *bookView;
    void createToolBars();
private slots:
    void on_action_Next_triggered();
    void on_actionPrevious_triggered();
    void on_actionPreView_triggered();
    void on_action_Close_triggered();
    void on_actionAbout_triggered();
    void on_action_Open_triggered();
    void previousPage();
    void nextPage();
//    void printPreview(QPrinter *);
};

#endif // MAINWINDOW_H
